﻿@model  List<Data.Web.Images>
@{
    ViewBag.Title = "Trang chủ";
} 
@using (Html.BeginForm(FormMethod.Get))
   { 
    
      <a href="#" id="modal_link"> Tải ảnh </a>
       @Html.DropDownList("CateId")
       <input type="submit"  value="Tìm kiếm" /> 
   }

@if (Model.Count > 0)
{
    
<div class="imageContainer">
@foreach (var item in Model)
{
    <div class="imageBox">
        <a href="@item.Url" target="_blank"><img src="@item.Url" alt="Image" class="imagePreview" /></a>
    </div>
}
</div>
}
else
{
<div class="imageCenter">
  Không có hình ảnh đã được tải lên cho đến nay. @Html.ActionLink("Click here", "UploadImage") để tải lên một hình ảnh.
</div>
}
<div class="clear"></div> 
@section Styles
{
<link href="@Url.Content("~/Content/Media/Media/Modal.css")" rel="stylesheet" />
<link href="@Url.Content("~/Content/Media/Media/ImageArea.css")" rel="stylesheet" />
}
@section Scripts
{
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.imgareaselect.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.fancyupload.js")"></script>
<script>
    $(document).ready(function () {
        $('.modal_block').click(function (e) {
            $('#tn_select').empty();
            $('.modal_part').hide();
        });
        $('#modal_link').click(function (e) {
            $('.modal_part').show();
            var context = $('#tn_select').load('/Home/UploadImage', function () {
                initSelect(context);
            });
            e.preventDefault();
            return false;
        });
    });
</script>
}
<div class="modal_block modal_part"></div>
<div class="modal_dialog modal_part" id="tn_select"></div> 
  
     
